package com.epoint.juc.callable;

import java.util.concurrent.CountDownLatch;

public class CountDownLatchDemo {

    public static void main(String[] args) throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(3);

        new Thread(()-> {
            System.out.println("冲~");
            latch.countDown();
        }).start();
        new Thread(()-> {
            System.out.println("冲~");
            latch.countDown();
        }).start();
        new Thread(()-> {
            System.out.println("冲~");
            latch.countDown();
        }).start();

        latch.await();

        System.out.println("全部结束");
    }

}
